# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-encoding-ber
_pkgname=Encoding-BER
pkgver=1.02
pkgrel=6
pkgdesc='Perl module for encoding/decoding data using ASN.1 Basic Encoding Rules (BER).'
arch=('any')
url='https://metacpan.org/pod/Encoding::BER'
license=('custom:unknown')
depends=('perl')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/J/JA/JAW/$_pkgname-$pkgver.tar.gz")
sha512sums=('bfdd415ca5f70912a50e781e9f61ef16e4015543102c4ab6107d1ec178ad4f30adcb1c5282e7051e427a15574c4902e3ad3180d06bbf6d34da0a2fc0f8e78437')

build() {
  cd "$_pkgname-$pkgver"

  (
    export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    /usr/bin/perl Makefile.PL
    make
  )
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find $pkgdir -name .packlist -o -name perllocal.pod -delete

  rm -rf "$pkgdir/usr/lib"
}

